#ifndef RULES_H
#define RULES_H



#include "includes.h"



class unit;


/**	@brief	Compares two doubles with some tollerantion
*	@param	a first double
*	@param	b second double
*	@return	true if doubles are of the same value, else false
*/
bool equal( double a, double b );

/**	@brief	Compares two doubles with some tollerantion
*	@param	a first double
*	@param	b second double
*	@return	true if first double than second one, else false
*/
bool greater( double a, double b );



/** @brief	Tests if unit can fire to diven target
*	@param	u attacking unit
*	@param	x x coordinate od the target
*	@param	y y coordinate od the target
*	@return	true if attack is possilbe, else false
*/
bool test_fire( unit* u, unsigned int x, unsigned int y );

/** @brief	Tests if unit can move to a destination
*	@param	path vector to be filled with coordinates of every movement of the unit, constraint: path != 0
*	@param	u moving unit
*	@param	x x coordinate of the destination
*	@param	y y coordinate of the destination
*	@return cost of movement when movement is possible, else -1
*/
int test_move( queue< pair< unsigned int, unsigned int > >* path, unit* u, unsigned int x, unsigned int y );



#endif